﻿<views:MvxWpfView xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"  
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:views="clr-namespace:MvvmCross.Wpf.Views;assembly=MvvmCross.Wpf"
	xmlns:vms="clr-namespace:Sidvall.WorkItemManager.UI.ViewModels;assembly=Sidvall.WorkItemManager.UI"
	xmlns:Controls="clr-namespace:Sidvall.WorkItemManager.UI.Wpf.Controls" 
	xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf" 
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
	xmlns:local="clr-namespace:Sidvall.WorkItemManager.UI.Wpf.Views"
	x:Class="Sidvall.WorkItemManager.UI.Wpf.Views.WorkerView"
	mc:Ignorable="d" 
	d:DesignHeight="600" d:DesignWidth="800">

	<views:MvxWpfView.Resources>
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
		<Converters:BooleanToVisibilityConverter x:Key="NotBooleanToVisibilityConverter" Not="True"/>
		<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
	</views:MvxWpfView.Resources>

	<Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:WorkerViewModel}}">
		<Grid.Background>
			<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.InactiveBorderColorKey}}"/>
		</Grid.Background>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition/>
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="200" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>

		<Controls:HeaderControl Grid.ColumnSpan="2" HeaderCaption="{Binding Title}" />

		<Grid Grid.Row="1">
			<Grid.Background>
				<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
			</Grid.Background>
			<StackPanel Orientation="Horizontal">
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Add.png" 
										ToolTip="Add" ButtonText="{Binding AddTreeItemCaption}" IsEnabled="{Binding CanAddTreeItem}" ButtonCommand="{Binding AddTreeItemCommand}" />
			</StackPanel>
		</Grid>
		<DataGrid x:Name="WorkerGrid" Grid.Row="2" ItemsSource="{Binding TreeItems}" AutoGenerateColumns="False" HeadersVisibility="None" CanUserReorderColumns="False" CanUserResizeColumns="False" RowHeaderWidth="0"
			PreviewMouseLeftButtonDown="WorkerGrid_PreviewMouseLeftButtonDown" MouseMove="WorkerGrid_MouseMove" DragOver="WorkerGrid_DragOver" Drop="WorkerGrid_Drop"
			CanUserResizeRows="False" CanUserSortColumns="False" SelectionMode="Single" CanUserAddRows="False" SelectedItem="{Binding ActiveTreeItem, Mode=TwoWay}" AllowDrop="True" Background="#FFF0F0F0">
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="SelectionChanged">
					<i:InvokeCommandAction Command="{Binding SelectTreeItemCommand}" />
				</i:EventTrigger>
			</i:Interaction.Triggers>
			<DataGrid.Columns>
				<DataGridTemplateColumn Width="*">
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<Grid AllowDrop="True">
								<Grid Visibility="{Binding IsServer, Converter={StaticResource BooleanToVisibilityConverter}}" ToolTip="Server" Background="#FF6AA8C5">
									<Grid.RowDefinitions>
										<RowDefinition Height="40" />
									</Grid.RowDefinitions>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="40" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>
									<Image Margin="5" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Server.png" Stretch="UniformToFill" />
									<TextBlock Grid.Column="1" Text="{Binding Name}" FontWeight="Bold" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="14" ToolTip="{Binding ItemTooltip}" ForceCursor="False" />
								</Grid>
								<Grid Visibility="{Binding IsWorker, Converter={StaticResource BooleanToVisibilityConverter}}" ToolTip="Worker">
									<Grid.RowDefinitions>
										<RowDefinition Height="30" />
									</Grid.RowDefinitions>
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="30" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>
									<Image Margin="5" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Worker.png" Stretch="UniformToFill" />
									<TextBlock Grid.Column="1" Text="{Binding Name}" Margin="5,0,0,0" VerticalAlignment="Center" ToolTip="{Binding ItemTooltip}" Visibility="{Binding IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" />
									<TextBlock Grid.Column="1" Text="{Binding Name}" Margin="5,0,0,0" VerticalAlignment="Center" ToolTip="{Binding ItemTooltip}" Visibility="{Binding IsEnabled, Converter={StaticResource NotBooleanToVisibilityConverter}}" Opacity="0.2" />
								</Grid>
								<Grid Visibility="{Binding IsItem, Converter={StaticResource BooleanToVisibilityConverter}}">
									<Grid.RowDefinitions>
										<RowDefinition Height="25" />
									</Grid.RowDefinitions>
									<Grid.ColumnDefinitions>
										<ColumnDefinition />
										<ColumnDefinition Width="Auto" />
									</Grid.ColumnDefinitions>

									<TextBlock Grid.Column="0" Text="{Binding Name}" VerticalAlignment="Center" ToolTip="{Binding ItemTooltip}" Visibility="{Binding IsEnabled, Converter={StaticResource BooleanToVisibilityConverter}}" />
									<TextBlock Grid.Column="0" Text="{Binding Name}" VerticalAlignment="Center" ToolTip="{Binding ItemTooltip}" Visibility="{Binding IsEnabled, Converter={StaticResource NotBooleanToVisibilityConverter}}" Opacity="0.2" />
									<TextBlock Grid.Column="0" Text="{Binding Name}" VerticalAlignment="Center" ToolTip="{Binding ItemTooltip}" Visibility="{Binding IsEnabledAndCanceled, Converter={StaticResource BooleanToVisibilityConverter}}">
										<TextBlock.TextDecorations>
											<TextDecoration Location="Strikethrough"/>
										</TextBlock.TextDecorations>
									</TextBlock>

									<StackPanel Grid.Column="1" Orientation="Horizontal">
										<Image Visibility="{Binding IsForceExecution, Converter={StaticResource BooleanToVisibilityConverter}}" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/WaitingToRun.png" Stretch="UniformToFill" ToolTip="Waiting to execute"  />
										<Image Visibility="{Binding IsExecuting, Converter={StaticResource BooleanToVisibilityConverter}}" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Executing.png" Stretch="UniformToFill" ToolTip="{Binding StatusTooltip}"  />
										<Image Visibility="{Binding LastResultIsCanceled, Converter={StaticResource BooleanToVisibilityConverter}}" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Result_Canceled.png" Stretch="UniformToFill" ToolTip="{Binding ResultTooltip}" />
										<Image Visibility="{Binding LastResultIsFailed, Converter={StaticResource BooleanToVisibilityConverter}}" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Result_Failed.png" Stretch="UniformToFill" ToolTip="{Binding ResultTooltip}" />
										<Image Visibility="{Binding LastResultIsOk, Converter={StaticResource BooleanToVisibilityConverter}}" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Result_OK.png" Stretch="UniformToFill" ToolTip="{Binding ResultTooltip}" />
									</StackPanel>
								</Grid>
							</Grid>
						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>
			</DataGrid.Columns>
		</DataGrid>
		<Border Grid.Row="3" BorderThickness="1" BorderBrush="Gray" Background="#FFF0F0F0">
			<StackPanel Grid.Row="3">
				<StackPanel Margin="5,5,5,0">
					<Label Content="Refresh Rate:"  />
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>

						<xctk:IntegerUpDown x:Name="txtRefreshRate" Width="50" HorizontalAlignment="Left" Minimum="1" Maximum="60" Value="2" ClipValueToMinMax="True" ParsingNumberStyle="Integer" />
						<Label Grid.Column="1" Content="seconds"/>
					</Grid>
				</StackPanel>
				<StackPanel Margin="5,5,5,0">
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>

						<Label Content="Last Updated:"/>
						<Image Grid.Column="1" Width="16" ToolTip="{Binding LastUpdatedException}" Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Result_Failed.png" Visibility="{Binding LastUpdatedExceptionIsVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" ></Image>
					</Grid>
					<TextBlock Grid.Row="1" Text="{Binding LastUpdated}" />
				</StackPanel>
			</StackPanel>
		</Border>

		<Grid Grid.Row="1" Grid.Column="1">
			<Grid.Background>
				<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
			</Grid.Background>
			<StackPanel Orientation="Horizontal">
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Save.png" 
										ToolTip="Save" ButtonCommand="{Binding SaveActiveTreeItemCommand}" IsEnabled="{Binding CanSave}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Refresh.png" 
										ToolTip="Reload" ButtonCommand="{Binding SelectTreeItemCommand}" IsEnabled="{Binding CanSave}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Enabled.png" 
										ToolTip="Disable" ButtonCommand="{Binding EnableTreeItemCommand}" IsEnabled="{Binding CanEnableTreeItem}"
										Visibility="{Binding TreeItemIsEnabled, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Disabled.png" 
										ToolTip="Enable" ButtonCommand="{Binding EnableTreeItemCommand}" IsEnabled="{Binding CanEnableTreeItem}"
										Visibility="{Binding TreeItemIsEnabled, Converter={StaticResource NotBooleanToVisibilityConverter}, Mode=OneWay}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Cancel.png" 
										ToolTip="Cancel" ButtonCommand="{Binding CancelTreeItemCommand}" IsEnabled="{Binding CanCancelTreeItem}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Start.png" 
										ToolTip="Run" ButtonCommand="{Binding RunTreeItemCommand}" IsEnabled="{Binding CanRunTreeItem}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Reset.png" 
										ToolTip="Reset" ButtonCommand="{Binding ResetActiveTreeItemCommand}" IsEnabled="{Binding CanReset}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Delete.png" 
										ToolTip="Remove" ButtonCommand="{Binding DeleteActiveTreeItemCommand}" IsEnabled="{Binding CanDelete}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Export.png" 
										ToolTip="Export" ButtonCommand="{Binding ExportSettingsCommand}" IsEnabled="{Binding CanDelete}" />
				<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Import.png" 
										ToolTip="Import" ButtonCommand="{Binding ImportSettingsCommand}" IsEnabled="{Binding CanAddTreeItem}" />
			</StackPanel>
		</Grid>
		<Grid Grid.Row="2" Grid.Column="1" Grid.RowSpan="2">
			<Grid.RowDefinitions>
				<RowDefinition/>
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
			</Grid.ColumnDefinitions>

			<Grid Grid.RowSpan="2" Visibility="{Binding InformationIsVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
				<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold"><Run Text="Select item"/></TextBlock>
			</Grid>

			<Grid Visibility="{Binding ServerIsVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
				<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20"><Run Text="Server"/></TextBlock>
			</Grid>

			<Grid Visibility="{Binding WorkerIsVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
				</Grid.ColumnDefinitions>

				<Grid Grid.Row="1">
					<StackPanel>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="130" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Content="Id"/>
							<TextBox Grid.Column="1" Text="{Binding ActiveWorker.WorkerId, Mode=OneWay}" Width="80" HorizontalAlignment="Left" IsReadOnly="True" />
						</Grid>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="130" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Content="Name"/>
							<TextBox Grid.Column="1" Text="{Binding ActiveWorker.Name}" IsReadOnly="{Binding CanEdit, Converter={StaticResource InverseBooleanConverter}, Mode=OneWay}" />
						</Grid>

						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="130" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Content="Description"/>
							<TextBox Grid.Column="1" Height="60" Text="{Binding ActiveWorker.Description}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" 
									 IsReadOnly="{Binding CanEdit, Converter={StaticResource InverseBooleanConverter}, Mode=OneWay}"/>
						</Grid>
					</StackPanel>
				</Grid>
			</Grid>

			<Grid Visibility="{Binding WorkItemIsVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition Height="Auto" />
					<RowDefinition />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
					<ColumnDefinition Width="300" />
				</Grid.ColumnDefinitions>

				<Grid Grid.Row="1" Grid.Column="0">
					<StackPanel>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="100" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Content="Id:"/>
							<TextBox Grid.Column="1" Width="100" HorizontalAlignment="Left" Text="{Binding ActiveWorkItem.WorkItemId, Mode=OneWay}" IsReadOnly="True" />
						</Grid>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="100" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Content="Name:"/>
							<TextBox Grid.Column="1" Text="{Binding ActiveWorkItem.Name}" IsReadOnly="{Binding CanEdit, Converter={StaticResource InverseBooleanConverter}, Mode=OneWay}" />
						</Grid>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="100" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Content="Description:"/>
							<TextBox Grid.Column="1" Height="60" Text="{Binding ActiveWorkItem.Description}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" 
									 IsReadOnly="{Binding CanEdit, Converter={StaticResource InverseBooleanConverter}, Mode=OneWay}" />
						</Grid>
					</StackPanel>
				</Grid>
				<Grid Grid.Row="1" Grid.Column="1" IsEnabled="{Binding CanEdit}">
					<StackPanel>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="110" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Grid.Column="0" Content="Failed Action:"/>
							<ComboBox Grid.Column="1" SelectedValuePath="Value" DisplayMemberPath="Key" SelectedValue="{Binding ActiveWorkItem.FailedAction}" ItemsSource="{Binding ThreadActions}" IsEnabled="{Binding CanEdit}" />
						</Grid>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="110" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Grid.Column="0" Content="Canceled Action:"/>
							<ComboBox Grid.Column="1" SelectedValuePath="Value" DisplayMemberPath="Key" SelectedValue="{Binding ActiveWorkItem.CanceledAction}" ItemsSource="{Binding ThreadActions}" IsEnabled="{Binding CanEdit}" />
						</Grid>
						<Grid Margin="5,5,5,0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="110" />
								<ColumnDefinition />
							</Grid.ColumnDefinitions>

							<Label Content="Task Type:"/>
							<ComboBox Grid.Column="1" ItemsSource="{Binding ActiveTreeItem.WorkItemTypes}" SelectedValuePath="WorkItemTypeId" DisplayMemberPath="Name" SelectedValue="{Binding ActiveWorkItem.WorkItemTypeId}" IsEnabled="{Binding CanEdit}" >
								<i:Interaction.Triggers>
									<i:EventTrigger EventName="SelectionChanged">
										<i:InvokeCommandAction Command="{Binding SelectTypeCommand}" />
									</i:EventTrigger>
								</i:Interaction.Triggers>
							</ComboBox>
						</Grid>
					</StackPanel>
				</Grid>
				<TabControl Grid.Row="2" Grid.ColumnSpan="2" Margin="5,5,5,0">
					<TabItem Header="Context">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition />
							</Grid.RowDefinitions>
							<ContentControl x:Name="WorkItemContextContent" Grid.Row="1" Margin="5,5,5,0" />
						</Grid>
					</TabItem>
					<TabItem Header="Conditions">
						<Grid>
							<Grid Visibility="{Binding ConditionListIsVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>

								<Grid Grid.ColumnSpan="3">
									<Grid.Background>
										<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
									</Grid.Background>
									<StackPanel Orientation="Horizontal">
										<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Add.png" 
											ToolTip="Add condition" ButtonCommand="{Binding AddConditionCommand}" IsEnabled="{Binding CanEdit}" />
									</StackPanel>
								</Grid>

								<DataGrid Grid.Row="1" RowHeaderWidth="0" ItemsSource="{Binding ActiveWorkItem.WorkItemWorkConditions}" AutoGenerateColumns="False" CanUserAddRows="False" RowHeight="55" CanUserResizeColumns="False" CanUserReorderColumns="False" CanUserResizeRows="False" SelectedItem="{Binding ActiveWorkItemCondition}">
									<i:Interaction.Triggers>
										<i:EventTrigger EventName="MouseDoubleClick">
											<i:InvokeCommandAction Command="{Binding EditConditionCommand}" IsEnabled="{Binding CanEdit}" CommandParameter="{Binding ActiveWorkItemCondition}" />
										</i:EventTrigger>
									</i:Interaction.Triggers>
									<DataGrid.Columns>
										<DataGridTemplateColumn Width="60" Header="Enabled">
											<DataGridTemplateColumn.CellTemplate>
												<DataTemplate>
													<CheckBox IsChecked="{Binding IsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" 
															  HorizontalAlignment="Center" VerticalAlignment="Center" 
															  IsEnabled="{Binding DataContext.CanEdit, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}"/>
												</DataTemplate>
											</DataGridTemplateColumn.CellTemplate>
										</DataGridTemplateColumn>
										<DataGridTemplateColumn Width="50" Header="Group" >
											<DataGridTemplateColumn.CellTemplate>
												<DataTemplate>
													<TextBox Text="{Binding GroupId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MaxLength="5" VerticalAlignment="Center" 
															 IsEnabled="{Binding DataContext.CanEdit, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}"/>
												</DataTemplate>
											</DataGridTemplateColumn.CellTemplate>
										</DataGridTemplateColumn>
										<DataGridTemplateColumn Width="*" Header="Description">
											<DataGridTemplateColumn.CellTemplate>
												<DataTemplate>
													<TextBlock Text="{Binding Description}" TextWrapping="Wrap" VerticalAlignment="Center" />
												</DataTemplate>
											</DataGridTemplateColumn.CellTemplate>
										</DataGridTemplateColumn>
										<DataGridTemplateColumn Width="35" IsReadOnly="True">
											<DataGridTemplateColumn.CellTemplate>
												<DataTemplate>
													<Button Width="32" Height="32" Background="{x:Null}" BorderBrush="{x:Null}" 
															Command="{Binding DataContext.EditConditionCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}"
															CommandParameter="{Binding}" IsEnabled="{Binding DataContext.CanEdit, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}">
														<Image Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Edit.png" ToolTip="Edit condition" />
													</Button>
												</DataTemplate>
											</DataGridTemplateColumn.CellTemplate>
										</DataGridTemplateColumn>
										<DataGridTemplateColumn Width="35" IsReadOnly="True">
											<DataGridTemplateColumn.CellTemplate>
												<DataTemplate>
													<Button Width="32" Height="32" Background="{x:Null}" BorderBrush="{x:Null}" 
															Command="{Binding DataContext.DeleteConditionCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}"
															CommandParameter="{Binding}" IsEnabled="{Binding DataContext.CanEdit, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}">
														<Image Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Delete.png" ToolTip="Delete condition" />
													</Button>
												</DataTemplate>
											</DataGridTemplateColumn.CellTemplate>
										</DataGridTemplateColumn>
									</DataGrid.Columns>
								</DataGrid>
							</Grid>
							<Grid Visibility="{Binding ConditionListIsVisible, Converter={StaticResource NotBooleanToVisibilityConverter}}">
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" />
									<RowDefinition />
								</Grid.RowDefinitions>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition Width="5" />
									<ColumnDefinition />
								</Grid.ColumnDefinitions>

								<Grid Grid.ColumnSpan="3">
									<Grid.Background>
										<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
									</Grid.Background>
									<StackPanel Orientation="Horizontal">
										<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Back.png" 
											ToolTip="Back to list" ButtonCommand="{Binding ShowConditionListCommand}" />
									</StackPanel>
								</Grid>

								<StackPanel Grid.Row="1">
									<Grid Margin="5,5,5,0">
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="130" />
											<ColumnDefinition Width="150" />
										</Grid.ColumnDefinitions>

										<Label Content="Condition:"/>
										<ComboBox Grid.Column="1" SelectedValuePath="WorkConditionId" DisplayMemberPath="Name" SelectedValue="{Binding ActiveWorkItemCondition.WorkConditionId}" ItemsSource="{Binding ActiveTreeItem.Conditions}" />
									</Grid>

									<Grid Margin="5,5,5,0">
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="130" />
											<ColumnDefinition />
										</Grid.ColumnDefinitions>

										<Label Content="Enabled"/>
										<CheckBox Grid.Column="1" IsChecked="{Binding ActiveWorkItemCondition.IsEnabled}" VerticalAlignment="Center" />
									</Grid>
								</StackPanel>
								<StackPanel Grid.Row="1" Grid.Column="2">
									<Grid Margin="5,5,5,0">
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="130" />
											<ColumnDefinition />
										</Grid.ColumnDefinitions>

										<Label Content="Invalid Action:"/>
										<ComboBox Grid.Column="1" Width="200" HorizontalAlignment="Left" SelectedValuePath="Value" DisplayMemberPath="Key" SelectedValue="{Binding ActiveWorkItemCondition.InvalidAction}" ItemsSource="{Binding ThreadActions}" />
									</Grid>

									<Grid Margin="5,5,5,0">
										<Grid.ColumnDefinitions>
											<ColumnDefinition Width="130" />
											<ColumnDefinition />
										</Grid.ColumnDefinitions>

										<Label Content="Enabled On Retry"/>
										<CheckBox Grid.Column="1" IsChecked="{Binding ActiveWorkItemCondition.IsEnabledOnRetry}" VerticalAlignment="Center" />
									</Grid>
								</StackPanel>

								<ContentControl Grid.Row="2" Grid.ColumnSpan="3" x:Name="WorkItemConditionContextContent" />
							</Grid>
						</Grid>
					</TabItem>
					<TabItem Header="Retry">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition />
							</Grid.RowDefinitions>

							<StackPanel>
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="150" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Retry Time:"/>
									<TextBox Grid.Column="1" Text="{Binding ActiveWorkItem.RetryTime}" IsReadOnly="True" Width="150" HorizontalAlignment="Left" />
								</Grid>
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="150" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Retry Count:"/>
									<TextBox Grid.Column="1" Text="{Binding ActiveWorkItem.RetryCount}" IsReadOnly="True" Width="150" HorizontalAlignment="Left" />
								</Grid>
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="150" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Retry Policy:"/>
									<ComboBox Grid.Column="1" Width="200" SelectedValuePath="WorkRetryPolicyId" DisplayMemberPath="Name" SelectedValue="{Binding ActiveWorkItem.WorkRetryPolicyId}" 
											  ItemsSource="{Binding ActiveTreeItem.RetryPolicies}" HorizontalAlignment="Left" IsEnabled="{Binding CanEdit}">
										<i:Interaction.Triggers>
											<i:EventTrigger EventName="SelectionChanged">
												<i:InvokeCommandAction Command="{Binding SelectRetryPolicyCommand}" />
											</i:EventTrigger>
										</i:Interaction.Triggers>
									</ComboBox>
									<Controls:ButtonControl Grid.Column="2" ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Clear.png" 
										ToolTip="Remove selection" ButtonCommand="{Binding DeleteRetryPolicyCommand}" IsEnabled="{Binding CanDeleteRetryPolicy}" />
								</Grid>
							</StackPanel>
							<ContentControl Grid.Row="1" x:Name="RetryPolicyContent" IsEnabled="{Binding CanEdit}" />
						</Grid>
					</TabItem>
					<TabItem Header="Result">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition />
							</Grid.RowDefinitions>
							<StackPanel>
								<Controls:SubHeaderControl Margin="5,5,5,0" HeaderCaption="Status" />

								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="130" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="30" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Status:"/>
									<ComboBox Grid.Column="1" Width="140" IsReadOnly="True" MaxDropDownHeight="0" ItemsSource="{Binding WorkItemStatuses}" SelectedValuePath="Value" DisplayMemberPath="Key" SelectedValue="{Binding ActiveWorkItem.WorkItemStatusId}" Padding="0" />
									<TextBox Grid.Column="3" Width="140" Text="{Binding ActiveWorkItem.ExecutionStartTime, Mode=OneWay}" IsReadOnly="True" HorizontalAlignment="Left" />
									<Label Grid.Column="4" Content="(execution start time)"/>
								</Grid>
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="130" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="30" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Updated:"/>
									<TextBox Grid.Column="1" Text="{Binding ActiveWorkItem.ExecutionContextUpdated}" IsReadOnly="True" Width="140" HorizontalAlignment="Left" />
									<TextBox Grid.Column="3" Width="140" Text="{Binding IdleTime, Mode=OneWay, StringFormat=\{0:dd\\.hh\\:mm\\:ss\}}" IsReadOnly="True" HorizontalAlignment="Left" />
									<Label Grid.Column="4" Content="(idle time)"/>
								</Grid>
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="130" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Work Done:"/>
									<ProgressBar Grid.Column="1" Value="{Binding ActiveWorkItem.ExecutionCompletionPercentage}" />
								</Grid>
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="130" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Failed Executions:"/>
									<TextBox Grid.Column="1" Text="{Binding ActiveWorkItem.FailedExecutionCount}" IsReadOnly="True" Width="140" HorizontalAlignment="Left" />
								</Grid>

								<Controls:SubHeaderControl Margin="5,5,5,0" HeaderCaption="Last Execution" />

								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="130" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Result:"/>
									<TextBox Grid.Column="1" Text="{Binding ActiveWorkItem.ResultTypeName, Mode=OneWay}" IsReadOnly="True" Width="140" HorizontalAlignment="Left" />
								</Grid>
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="130" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="30" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Content="Time:"/>
									<TextBox Grid.Column="1" Text="{Binding ActiveWorkItem.LastExecutionStartTime}" IsReadOnly="True" Width="140" HorizontalAlignment="Left" />
									<Label Grid.Column="2"  Content="to" HorizontalContentAlignment="Right"/>
									<TextBox Grid.Column="3" Text="{Binding ActiveWorkItem.LastExecutionEndTime}" IsReadOnly="True" Width="140" HorizontalAlignment="Left" />
									<Label Grid.Column="4"  Content="total time"/>
									<TextBox Grid.Column="5" Text="{Binding ActiveWorkItem.LastExecutionTime, Mode=OneWay}" IsReadOnly="True" Width="80" HorizontalAlignment="Left" />
								</Grid>
							</StackPanel>
							<Grid Grid.Row="1" Margin="5,5,5,5">
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition />
								</Grid.RowDefinitions>

								<Label Grid.Row="0" Content="Message"/>
								<TextBox Grid.Row="1" Text="{Binding ActiveWorkItem.LastResultMessage}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" IsReadOnly="True" />
							</Grid>
						</Grid>
					</TabItem>
					<TabItem Header="Execution Context">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="Auto" />
								<RowDefinition />
								<RowDefinition Height="Auto" />
							</Grid.RowDefinitions>
							
							<Grid>
								<Grid.Background>
									<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
								</Grid.Background>
								<StackPanel Orientation="Horizontal">
									<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Delete.png" 
											ToolTip="Reset execution context" ButtonCommand="{Binding ResetExecutionContextCommand}" IsEnabled="{Binding CanDeleteLogs}" />
								</StackPanel>
							</Grid>

							<ContentControl x:Name="WorkItemExecutionContextContent" Grid.Row="2" Margin="5,5,5,0" />
						</Grid>
					</TabItem>
					<TabItem Header="Sensors">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="Auto" />
								<RowDefinition />
								<RowDefinition Height="Auto" />
							</Grid.RowDefinitions>
							<StackPanel Grid.Row="1">
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="140" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Grid.Column="0" Content="Sensor Log Day Count:"/>
									<xctk:IntegerUpDown Grid.Column="1" Width="70" Value="{Binding ActiveWorkItem.SensorLogDayCount}" ClipValueToMinMax="True" ParsingNumberStyle="Integer" 
														Minimum="0" HorizontalAlignment="Left" IsReadOnly="{Binding CanEdit, Converter={StaticResource InverseBooleanConverter}, Mode=OneWay}" />
								</Grid>
							</StackPanel>
							<DataGrid Grid.Row="2" RowHeaderWidth="0" ItemsSource="{Binding ActiveWorkItem.WorkItemSensors}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" MinRowHeight="50">
								<DataGrid.Columns>
									<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="100" IsReadOnly="True" />
									<DataGridTextColumn Header="Description" Binding="{Binding Description}" Width="*" IsReadOnly="True">
										<DataGridTextColumn.ElementStyle>
											<Style TargetType="TextBlock">
												<Setter Property="TextWrapping" Value="Wrap" />
											</Style>
										</DataGridTextColumn.ElementStyle>
									</DataGridTextColumn>
									<DataGridTextColumn Header="Value" Binding="{Binding Value}" Width="100" IsReadOnly="True">
										<DataGridTextColumn.ElementStyle>
											<Style TargetType="TextBlock">
												<Setter Property="TextWrapping" Value="Wrap" />
											</Style>
										</DataGridTextColumn.ElementStyle>
									</DataGridTextColumn>
									<DataGridTextColumn Header="Time Stamp" Binding="{Binding ValueTimestamp}" Width="140" IsReadOnly="True">
										<DataGridTextColumn.ElementStyle>
											<Style TargetType="TextBlock">
												<Setter Property="TextWrapping" Value="Wrap" />
											</Style>
										</DataGridTextColumn.ElementStyle>
									</DataGridTextColumn>
								</DataGrid.Columns>
							</DataGrid>
						</Grid>
					</TabItem>
					<TabItem Header="Log">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="Auto" />
								<RowDefinition />
								<RowDefinition Height="Auto" />
							</Grid.RowDefinitions>

							<Grid>
								<Grid.Background>
									<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
								</Grid.Background>
								<StackPanel Orientation="Horizontal">
									<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Refresh.png" 
										ToolTip="Reload log items" ButtonCommand="{Binding RefreshLogCommand}" />
									<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Delete.png" 
											ToolTip="Delete all log items" ButtonCommand="{Binding DeleteLogsCommand}" IsEnabled="{Binding CanDeleteLogs}" />
									<StackPanel Orientation="Horizontal">
										<Label Content="Show:" VerticalContentAlignment="Center"/>
										<RadioButton Content="All" GroupName="Options1" IsChecked="{Binding Path=LogFilterAll, Mode=TwoWay}" VerticalContentAlignment="Center" Margin="0,0,10,0">
											<i:Interaction.Triggers>
												<i:EventTrigger EventName="Checked">
													<i:InvokeCommandAction Command="{Binding RefreshLogCommand}" />
												</i:EventTrigger>
											</i:Interaction.Triggers>
										</RadioButton>
										<RadioButton Content="Errors" GroupName="Options1" IsChecked="{Binding Path=LogFilterErrors, Mode=TwoWay}" VerticalContentAlignment="Center" Margin="0,0,10,0">
											<i:Interaction.Triggers>
												<i:EventTrigger EventName="Checked">
													<i:InvokeCommandAction Command="{Binding RefreshLogCommand}" />
												</i:EventTrigger>
											</i:Interaction.Triggers>
										</RadioButton>
										<RadioButton Content="Messages" GroupName="Options1" IsChecked="{Binding Path=LogFilterMessages, Mode=TwoWay}" VerticalContentAlignment="Center" Margin="0,0,10,0">
											<i:Interaction.Triggers>
												<i:EventTrigger EventName="Checked">
													<i:InvokeCommandAction Command="{Binding RefreshLogCommand}" />
												</i:EventTrigger>
											</i:Interaction.Triggers>
										</RadioButton>
									</StackPanel>
								</StackPanel>
							</Grid>
							<StackPanel Grid.Row="1" IsEnabled="{Binding CanEdit}">
								<Grid Margin="5,5,5,0">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition Width="Auto" />
										<ColumnDefinition />
									</Grid.ColumnDefinitions>

									<Label Grid.Column="0" Content="Log Day Count:"/>
									<xctk:IntegerUpDown Grid.Column="1" Width="70" Value="{Binding ActiveWorkItem.LogDayCount}" ClipValueToMinMax="True" ParsingNumberStyle="Integer" Minimum="1" HorizontalAlignment="Left" />
									<Label Grid.Column="2" Content="Log:"/>
									<xctk:CheckComboBox Grid.Column="3" Width="300" HorizontalAlignment="Left" ItemsSource="{Binding LogModes}" ValueMemberPath="Value" DisplayMemberPath="Key" SelectedMemberPath="IsSelected" />
								</Grid>
							</StackPanel>
							<DataGrid Grid.Row="2" Margin="0,5,0,0" RowHeaderWidth="0" ItemsSource="{Binding ActiveWorkItem.WorkItemLogs}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" MinRowHeight="50">
								<DataGrid.Columns>
									<DataGridTextColumn Header="End Time" Binding="{Binding ExecutionEndTime}" IsReadOnly="True" />
									<DataGridTextColumn Header="Result" Binding="{Binding ResultTypeName}" IsReadOnly="True" />
									<DataGridTemplateColumn Header="Message" Width="*" IsReadOnly="True">
										<DataGridTemplateColumn.CellTemplate>
											<DataTemplate>
												<TextBox AcceptsReturn="True" AcceptsTab="True" TextWrapping="Wrap" Text="{Binding ResultMessage}" VerticalScrollBarVisibility="Visible" IsReadOnly="True" MaxHeight="100" />
											</DataTemplate>
										</DataGridTemplateColumn.CellTemplate>
									</DataGridTemplateColumn>
									<DataGridTemplateColumn Width="Auto" IsReadOnly="True">
										<DataGridTemplateColumn.CellTemplate>
											<DataTemplate>
												<StackPanel Orientation="Horizontal">
													<Button Width="32" Height="32" Background="{x:Null}" BorderBrush="{x:Null}" 
															Command="{Binding DataContext.OpenLogCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}"
															CommandParameter="{Binding}">
														<Image Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Open.png" ToolTip="Open log item" />
													</Button>
													<Button Width="32" Height="32" Background="{x:Null}" BorderBrush="{x:Null}" 
															Command="{Binding DataContext.DeleteLogCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}"
															IsEnabled="{Binding DataContext.CanDeleteLogs, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:WorkerView}}}"
															CommandParameter="{Binding}">
														<Image Source="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Delete.png" ToolTip="Delete log item" />
													</Button>
												</StackPanel>
											</DataTemplate>
										</DataGridTemplateColumn.CellTemplate>
									</DataGridTemplateColumn>
								</DataGrid.Columns>
							</DataGrid>
							<Grid Grid.Row="3">
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<Grid.Background>
									<SolidColorBrush Color="#FFD1E0F1" Opacity="0.6"/>
								</Grid.Background>
								
								<StackPanel  Orientation="Horizontal">
									<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/GoFirst.png" 
										ToolTip="First page" ButtonCommand="{Binding PageFirstLogCommand}" IsEnabled="{Binding CanPageBackLog}" />
									<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Back.png" 
										ToolTip="Previous page" ButtonCommand="{Binding PageBackLogCommand}" IsEnabled="{Binding CanPageBackLog}" />
									<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/Forward.png" 
										ToolTip="Next page" ButtonCommand="{Binding PageForwardLogCommand}" IsEnabled="{Binding CanPageForwardLog}" />
									<Controls:ButtonControl ImageHeight="36" ImageWidth="36" ImageSource="/Sidvall.WorkItemManager.UI.Wpf;component/Images/GoLast.png" 
										ToolTip="Last page" ButtonCommand="{Binding PageLastLogCommand}" IsEnabled="{Binding CanPageForwardLog}" />
									<Grid Margin="5,5,5,5">
										<TextBlock Text="{Binding LogCaption}" VerticalAlignment="Center" />
									</Grid>
								</StackPanel>
							</Grid>
						</Grid>
					</TabItem>
				</TabControl>
			</Grid>
		</Grid>
	</Grid>
</views:MvxWpfView>
